#include "trm/segment.h"
#include <windows.h>

namespace trm {

void segment::check_mem() 
{
	MEMORYSTATUS mem;
	GlobalMemoryStatus(&mem);
	size_t const limit = 32*1024*1024;
	if (mem.dwAvailVirtual < limit)
		throw no_virt_mem();
	if (mem.dwAvailPageFile < limit)
		throw no_page_mem();
}

} //namespace trm
